package ace.module.common.core.test.core.listener;

import ace.module.common.core.test.core.service.InitDataService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author caspar
 * @date 2023/3/22 14:42
 */
@Slf4j
@RequiredArgsConstructor
@Component
public class InitDataHandlerListener implements ApplicationListener<ApplicationStartedEvent> {

  private final InitDataService initDataService;

  @Override
  public void onApplicationEvent(ApplicationStartedEvent event) {
    this.initDataService.init();
  }

}
